<%@page import="com.rocky.ssm.dao.stuBaseDao"%>
<%@page import="com.rocky.ssm.model.Students"%>
<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
<%
	//此页面负责处理学员信息修改过后的处理
	//1 处理编码
	request.setCharacterEncoding("utf-8");
	response.setCharacterEncoding("utf-8");

	//2 接收参数(后期考虑是否可以循环遍历传值)
	int stuId = 0;
	String strId =request.getParameter("stu_id");
		stuId = Integer.parseInt(strId);
	String stuName = request.getParameter("stu_name");
	String stuGender = request.getParameter("stu_gender");
	String strAge = request.getParameter("stu_age");
	int stuAge = 0;
	if(strAge != null && !"".equals(strAge)) {
		stuAge = Integer.parseInt(strAge.trim());		
	}
	String stuTel = request.getParameter("stu_tel");
	String stuEmail = request.getParameter("stu_email");
	String stuIdcard = request.getParameter("stu_IDcard");
	String stuAddress = request.getParameter("stu_address");
	String stuBirth = request.getParameter("stu_birth");
	String stuSchool = request.getParameter("stu_school");
	String stuQq = request.getParameter("stu_QQ");
	String stuParentName = request.getParameter("stu_parent_name");
	String stuProvince = request.getParameter("stu_province");
	String stuParentTel = request.getParameter("stu_parent_tel");
	String stuCity = request.getParameter("stu_city");
	String stuStatus = request.getParameter("stu_status");
	String stuContent = request.getParameter("stu_content");
	
	
	//3 和对象建立关联关系
	Students students = new Students(stuId,stuName,stuAge,
			stuGender,stuIdcard,stuBirth,
			stuEmail,stuTel,stuAddress,stuQq,
			stuSchool,stuParentName,stuParentTel,
			stuProvince,stuCity,stuStatus,
			stuContent);
	
	//4 调用修改方法
	stuBaseDao sbd = new stuBaseDao();
	 int result = sbd.stuPayModify(students);	
	//5 页面跳转
	if(result>0) {
		request.getRequestDispatcher("stu_pay.jsp").forward(request, response);
	} else {
	
		request.getRequestDispatcher("stu_pay.jsp").forward(request, response);
	}
%>
